package com.zhz.company.repository.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhz.common.tool.mybatisplus.base.dal.entity.BasePO;
import com.zhz.common.tool.mybatisplus.base.dal.repository.impl.BaseRepositoryImpl;
import com.zhz.company.repository.dao.CompanyDao;
import com.zhz.company.repository.service.CompanyService;
import com.zhz.model.company.Company;
import com.zhz.model.company.contract.dto.CompanyDTO;
import com.zhz.model.company.contract.param.CompanyQueryParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * @author zhouhengzhe
 * @date 2023/3/22
 */
@Service
public class CompanyServiceImpl extends BaseRepositoryImpl<CompanyDao, CompanyDTO, Company, CompanyQueryParam> implements CompanyService {
    @Override
    protected QueryWrapper<Company> getWrapper(CompanyQueryParam queryParam) {
        return getDefaultWrapper()
                .eq(StringUtils.isNotBlank(queryParam.getId()), BasePO.ID, queryParam.getId());
    }
}
